package com.novelastudios.events
{
	import flash.events.Event;
	
	/**
	 * 
	 * @author JohnBailey, NovelaStudios ©2008
	 * 
	 */	
	public class UserNotificationEvent extends GenericEvent
	{
		/**
		 * @internal
		 * These types are designed to be used for the type of notification to display to the user 
		 */		
		public static const ERROR:String 	= "UserNotificationEvent.ERROR";
		public static const WARNING:String 	= "UserNotificationEvent.WARNING";
		public static const SUCCESS:String 	= "UserNotificationEvent.SUCCESS";
		public static const INFO:String		= "UserNotificationEvent.INFO";
		
		public function UserNotificationEvent(type:String, message:String, data:Object=null, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, data, bubbles, cancelable);
			_message = message ? message : "";
		}
		
		///////////////////////////////////////////////////////////////////////////////
		//								ACCESSORS
		///////////////////////////////////////////////////////////////////////////////
		
		///////////////////////////////
		//-------------------------
		//	message
		//-------------------------
		/**
		 * @private
		 */
		private var _message:String;
		/**
		 * The message for the user 
		 * 
		 * @return the message for the user
		 * 
		 */		
		public function get message():String
		{
			return _message;
		}
		
		///////////////////////////////////////////////////////////////////////////////
		//								PUBLIC METHODS
		///////////////////////////////////////////////////////////////////////////////
		/**
		 * 
		 */		
		override public function toString():String 
		{
			return formatToString("UserNotificationEvent", "type", "message", "data", "bubbles", "cancelable");
		}
		
		/**
		 * @description  Returns a copy of the event instance.
		 *
		 * @returns  A copy of the event.
		 */
		override public function clone():Event
		{
			return new UserNotificationEvent(type,message,data,bubbles,cancelable);	
		}
	}
}